<?php
$option= array(
            'inputDefaults' => array(
                'div' => array(
                	'class' => 'form-group'
                ),
                'label' => array(
                	'class' => ' col-md-push'
                ),
                'between' => '<div class="col-lg-6 right">',
                'seperator' => '</div>',
                'after' => '</div>',
                'class' => 'form-control',
                'error' => array('attributes' => array('wrap' => 'span', 'class' => 'help-block')),
            ),
            'class' => 'form-horizontal form-stacked',
            'role' => 'form',
        );
?>
<div class="row">
	<div class="page-header">
	  <h1>Nuevo Cliente</h1>
	</div>

	<?php echo $this->Session->flash(); ?>

	<div class="col-sm-12 col-md-12">
		<div id="signup" class="lock-screen">
		
		  	
		  	<?php echo $this->Form->create('User',$option); ?>
					<fieldset>
						<?php echo $this->Form->input('first_name' ,array('label' => array( 'text' => __('Nombre:'),'class' => 'col-lg-2 control-label') ))?>
						<?php echo $this->Form->input('last_name',array( 'class'=>'form-control chosen-select ','label' => array( 'text' => __('Apellido:'),'class' => 'col-lg-2 control-label' ),'empty'=>'Cliente', 'multiple' => false));?>
						<?php echo $this->Form->input('username',array( 'type'=>'text' ,'label' => array( 'text' => __('Usuario:'),'class' => 'col-lg-2 control-label' )));?>
						<?php echo $this->Form->input('password',array( 'type'=>'text' ,'label' => array( 'text' => __('Contraseña:'),'class' => 'col-lg-2 control-label' )));?>						
						<!-- <?php echo $this->Form->input('email',array( 'label' => array( 'text' => __('Email:'),'class' => 'col-lg-2 control-label' ),'empty'=>'Tiempo'));?> -->
						
						<?php echo $this->Form->input('group_id',array( 'label' => array( 'text' => __('Typo de Usuario:'),'class' => 'col-lg-2 control-label '),'empty'=>'Typo de Usuario'));?>														
					<div class="form-group">
					    <div class="col-sm-offset-2 col-sm-10">
					      <button type="submit" class="btn btn-primary">Guardar</button>
					      <?php echo $this->Html->link(__('Cancelar', true), array('controller' => 'clients', 'action' => 'index' ),array('class'=>'btn btn-primary')); ?> 	
					      
					    </div>
					  </div>
					</fieldset>	

				<?php echo $this->Form->end(); ?>
		</div>

	</div>
</div>

<script type="text/javascript">
	/*$(function(){
		$("#UsersFirstName").blur(function(){			
			var text = $(this).val();
			console.debug("Nombre: %o", text);
			$("#UsersUsername").val(text);
		});
		$("#UsersLastName").blur(function(){
			var text = $(this).val();
			console.debug("Apellido: %o", text);
			var username = $("#UsersUsername").val();
			username= username+text;
			console.debug("username: %o", username);
			$("#UsersUsername").val(username);
			var randomnumber = Math.floor(Math.random() * (9999 - 1000 + 1));
			//console.debug("randomnumber: %o", randomnumber);
			$("#UsersPassword").val(randomnumber);
		});
	});*/
</script>